<h3>编辑文章</h3>

<% form_for(@article,:url=>article_category_article_path(@article.article_category_id),:html=>{:multipart=>true}) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :title ,"标题"%>
    <%= f.text_field :title %>
  </p>
  <p>
    <%= f.label :article_category ,"类别"%>
    <%= f.select :article_category_id,@cate.collect{|c| [c.name,c.id]}%>
  </p>
  <p>
    <%= f.label :article_order ,"排序"%>
    <%= f.text_field :article_order,:size=>10%>
  </p>
  <p>
    <%= f.label :come_from ,"摘自"%>
    <%= f.text_field :come_from %>
  </p>
  <p>
    <%= f.label :short_description ,"简短描述"%>
    <%= f.text_area :short_description %>
  </p>
  <p>
    <%= f.label :recommend ,"是否推荐"%>
    <%= f.check_box :recommend %>
  </p>
  <p>
    <%= f.label :key_word ,"关键词"%>
    <%= f.text_field :key_word %>
  </p>
  <p>
    <%= f.label :click_count  ,"点击数"%>
    <%= f.text_field :click_count %>
  </p>
  <p>
    <%= f.label :image ,"图片"%>
    <%= f.file_field :image %><%=image_tag @article.image_name ? "newsimgs/#{@article.image_name}":"noimage",:size=>"30x30" %>
  </p>
    <p><%=render :partial=>"online_editor",:locals=>{:hidden_name=>"article_content[content]",:content=>@article.article_content.content,:identity_id=>nil} %></p>

  <p>
    <%= f.submit "更新" %>
  </p>
<% end %>

<%= link_to 'Back', article_category_articles_path(0) %>
<fieldset class="demo">
  <LEGEND>操作说明：</LEGEND>
  <p>
    更改文章

  </p>
</fieldset>

